import * as types from '../mutation-types'

// initial state
const state = {
  all: []
}

// actions
const actions = {
  addProducts ({ commit }, allProducts) {
    commit(types.ADD_PRODUCTS, allProducts)
  }
}

// mutations
const mutations = {
  [types.ADD_PRODUCTS] (state, allProducts) {
    state.all = allProducts
  }
}

export default {
  state,
  actions,
  mutations
}
